package demo;

import com.taobao.api.ApiException;
import com.taobao.api.DefaultTaobaoClient;
import com.taobao.api.TaobaoClient;
import com.taobao.api.request.TmcUserPermitRequest;
import com.taobao.api.response.TmcUserPermitResponse;

public class Permit {
	public static void main(String[] args) {
		
		String appkey = "1021820838";
		String secret = "sandbox2a3b4dbc7f7139ac4d7304bdf";
		final String sessionKey = "6100514c989b9e3202e9af1e58de9777de922c64deeceff3638380614";
		String url = "http://gw.api.tbsandbox.com/router/rest";
		
		TaobaoClient client=new DefaultTaobaoClient(url, appkey, secret);
		TmcUserPermitRequest req=new TmcUserPermitRequest();
		req.setTopics("taobao_trade_TradeCreate");
		try {
			TmcUserPermitResponse response = client.execute(req , sessionKey);
			System.out.println(response.getBody());
			System.out.println(response.getIsSuccess());
		} catch (ApiException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
}
